package com.mima.minaserver.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.springframework.format.annotation.DateTimeFormat;

@Entity
@Table(name="t_heartbeat")
public class HeartBeatEntity {

	public HeartBeatEntity(String uuid,String username,String password,Date heartpTime,Integer key_id) {
		this.uuid = uuid;
        this.username = username;
        this.password = password;
        this.heartpTime = heartpTime;
        this.key_id = key_id;
    }
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id")
	private Integer id;
	
	@Column(name = "uuid")
	private String uuid;
	
	
	@Column(name = "username")
	private String username;
	
	@Column(name = "password")
	private String password;
	
	@Column(name = "heartp_time")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date heartpTime;
	
	@Column(name = "key_id")
	private Integer key_id;

	public HeartBeatEntity() {
		// TODO Auto-generated constructor stub
	}

	@Override
	public String toString() {
		return "HeartBeat [id=" + id + ", uuid=" + uuid  + ", username=" + username + ", password=" + password + ", heartpTime=" + heartpTime + "]";
	}
	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
	
	public void setId(Integer id) {
		this.id = id;
	}

	public Date getHeartpTime() {
		return heartpTime;
	}

	public Integer getKey_id() {
		return key_id;
	}

	public void setKey_id(Integer key_id) {
		this.key_id = key_id;
	}


	public void setHeartpTime(Date heartpTime) {
		this.heartpTime = heartpTime;
	}

	public Integer getId() {
		return id;
	}
}
